<?php
session_start();
include 'connect.php';
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
                    "http://www.w3.org/TR/html4/loose.dtd">
<link rel="stylesheet" type="text/css" href="forms.css"/>
<link rel="stylesheet" type="text/css" href="styles.css">
  <script src="http://code.jquery.com/jquery-latest.js"></script>
  <script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js"></script>
  <script>
  $(document).ready(function(){
    $("#bookForm").validate();
  });
  </script>
</head>
<body>
  
<div class="logo"></div> 
<div id="container">
<div id="MainContent">

</head>
<body>
 <?php

$sql = "SELECT * FROM members WHERE MemberID=".$_SESSION['MemberID'];
$result = mysql_query($sql);
if (!$result) {
    $message  = 'Invalid query: ' . mysql_error() . "\n" . 'Whole query: ' . $sql;
    die($message);
}
$row = mysql_fetch_assoc($result);
?>

 <form id="bookForm" method="post" action="updateProfile.php">
 <fieldset>
   <legend class="title">Update Profile</legend>
	<input id="MemberId" name="MemberId" value="<?php echo $row["MemberID"]; ?>" type="hidden" />
	  <p>
     <label for="Name">Name</label> <em>*</em><br />
    <input id="Name" name="Name" size="25" value="<?php echo $row["Name"]; ?>" class="required" minlength="2" />
   </p>
   <p>
     <label for="email">Email</label> <em>*</em><br />
     <input id="Email" name="Email" size="25" value="<?php echo $row["Email"]; ?>" class="required" minlength="2" />
   </p>
   <p>
     <label for="Phone">Phone</label> <em>*</em><br />
     <input id="Phone" name="Phone" size="25"  value="<?php echo $row["Phone"]; ?>" size="<?php echo strlen($row["title"]); ?>" class="required" />
   </p>
 
   <p>
<input type="submit" value="Update" name="Update"/>
<input type="submit" value="Delete" name="Delete"/>
<a href="memberProfile.php">Cancel</a>
   </p>
 </fieldset>
 </form>
 </div>
 </div>
</body>
</html>